package com.maretska.java.polymorphsm;

/**
 * Belajar tentang polymorpism
 */

public class Salary extends Employee{
	
	private double salary;
	// Automatically created when the superclass have a Constructors 
	public Salary(String name, String address, int number) {
		super(name, address, number);
		setSalary(number);
	}
	
	@Override
	public void mailCheck()
	   {
	       System.out.println("Within mailCheck of Salary class ");
	       System.out.println("Mailing check to " + getName()
	       + " with salary " + salary);
	   }
	
	public double getSalary() {
		return salary;
	}
	public void setSalary(double newSalary) {
		 if(newSalary >= 0.0)
	       {
	          salary = newSalary;
	       }
	}
}
